home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / New System Software Extensions / QuickDraw™ 3D 1.0 / Development / Interfaces / QD3D.h next >
Encoding:
C/C++ Source or Header  |  1995-06-01  |  26.8 KB  |  845 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                              **
  3.  **     Module:        QD3D.h                                                     **                        
  4.  **                                                                              **
  5.  **                                                                              **
  6.  **     Purpose:     System include file.                                     **            
  7.  **                                                                              **
  8.  **                                                                              **
  9.  **                                                                              **
  10.  **     Copyright (C) 1992-1995 Apple Computer, Inc.  All rights reserved.     **
  11.  **                                                                              **
  12.  **                                                                              **
  13.  *****************************************************************************/
  14. #ifndef QD3D_h
  15. #define QD3D_h
  16.  
  17. #include <stdio.h>
  18.  
  19. /******************************************************************************
  20.  **                                                                             **
  21.  **                                Porting Control                                 **
  22.  **                                                                             **
  23.  *****************************************************************************/
  24.  
  25. #ifndef OS_MACINTOSH
  26.  
  27.     #define OS_MACINTOSH                1
  28.     #define WINDOW_SYSTEM_MACINTOSH        1
  29.  
  30.     #if defined(THINK_C) || defined(THINK_CPLUS) || defined(__MWERKS__)
  31.          #define PRAGMA_ONCE                1
  32.     #else
  33.          #define PRAGMA_ONCE                0
  34.     #endif  /*  defined(THINK_C) || defined(THINK_CPLUS) || defined(__MWERKS__)  */
  35.  
  36.     /*
  37.      * Set required compiler options (if possible):
  38.      *   1. enums must always be ints in QD3D and in applications;
  39.      *      this consistency is required to prevent misinterpretation
  40.      *      of an app's enum values by an API; it is also required for
  41.      *      compliance with ANSI
  42.      *   2. alignment of char and short arrays in structures is not on
  43.      *      long boundaries; (could be other way, but must be consistent
  44.      *      in QD3D and in applications)
  45.      *   3. alignment of longs, floats, and pointers in structures
  46.      *      is on long boundaries for PowerPC
  47.      */
  48.     #if defined(THINK_C) || defined(THINK_CPLUS)
  49.         #pragma options(!pack_enums, !align_arrays)
  50.     #elif defined(__MWERKS__)
  51.         #pragma enumsalwaysint on
  52.         #pragma align_array_members off
  53.         #pragma options align=native
  54.     #elif defined(__PPCC__)
  55.         #pragma options align=power
  56.     #endif
  57.     
  58.     enum {
  59.         gestaltQD3D                = 'qd3d',
  60.         gestaltQD3DNotPresent    = 0,
  61.         gestaltQD3DAvailable    = 1
  62.     };
  63.     
  64. #endif  /*  OS_MACINTOSH  */
  65.  
  66. #if defined(_WIN32) && _WIN32
  67.     #define WINDOW_SYSTEM_WINDOWS        1
  68. #endif  /*  defined(_WIN32) && _WIN32  */
  69.  
  70. #if defined(PRAGMA_ONCE) && PRAGMA_ONCE
  71.     #pragma once
  72. #endif  /*  PRAGMA_ONCE  */
  73.  
  74. /*
  75.  *  NOTE:  To compile on a Unix workstation (assumes X11 window system):
  76.  *                1. Add to compiler command line: "-DOS_MACINTOSH=0"
  77.  *                2. Add "-DOS_UNIX=1"
  78.  *                3. Add "-DWINDOW_SYSTEM_X11=1"
  79.  */
  80.     
  81. /*
  82.  *  NOTE:  To compile on a DOS/WINDOWS machine:
  83.  *                1. Add to compiler command line: "-DOS_MACINTOSH=0"
  84.  *                2. Add "-DOS_WINDOWS=1"
  85.  *                3. Add "-DWINDOW_SYSTEM_WINDOWS=1"
  86.  */
  87.  
  88.  
  89. /******************************************************************************
  90.  **                                                                             **
  91.  **                                Export Control                                 **
  92.  **                                                                             **
  93.  *****************************************************************************/
  94.  
  95. #if defined(_MSC_VER)    /* Microsoft Visual C */
  96.     #define QD3D_EXPORT        __declspec( dllexport )
  97. #else
  98.     #define QD3D_EXPORT
  99. #endif  /*  _MSC_VER  */
  100.  
  101.  
  102. /******************************************************************************
  103.  **                                                                             **
  104.  **                                NULL definition                                 **
  105.  **                                                                             **
  106.  *****************************************************************************/
  107.  
  108. #ifndef NULL
  109. #error /*    NULL is undefined?    */
  110. #endif /* NULL */
  111.  
  112.  
  113. /******************************************************************************
  114.  **                                                                             **
  115.  **                                    Objects                                     **
  116.  **                                                                             **
  117.  *****************************************************************************/
  118. /*
  119.  * Everything in QuickDraw 3D is an OBJECT: a bunch of data with a type,
  120.  * deletion, duplication, and i/o methods.
  121.  */
  122. typedef long                    TQ3ObjectType;
  123.  
  124. typedef struct TQ3ObjectPrivate    *TQ3Object;
  125.  
  126. /*
  127.  * There are four subclasses of OBJECT:
  128.  *    an ELEMENT, which is data that is placed in a SET
  129.  *    a SHAREDOBJECT, which is reference-counted data that is shared
  130.  *    VIEWs, which maintain state information for an image
  131.  *    a PICK, which used to query a VIEW
  132.  */
  133. typedef TQ3Object                TQ3ElementObject;
  134. typedef TQ3Object                TQ3SharedObject;
  135. typedef TQ3Object                TQ3ViewObject;
  136. typedef TQ3Object                TQ3PickObject;
  137.  
  138. /*
  139.  * There are several types of SharedObjects:
  140.  *    RENDERERs, which paint to a drawContext
  141.  *    DRAWCONTEXTs, which are an interface to a device 
  142.  *    SETs, which maintains "mathematical sets" of ELEMENTs
  143.  *    FILEs, which maintain state information for a metafile
  144.  *    SHAPEs, which affect the state of the View
  145.  *    SHAPEPARTs, which contain geometry-specific data about a picking hit
  146.  *    CONTROLLERSTATEs, which hold state of the output channels for a CONTROLLER
  147.  *    TRACKERs, which represent a position and orientation in the user interface
  148.  *  STRINGs, which are abstractions of text string data.
  149.  *    STORAGE, which is an abstraction for stream-based data storage (files, memory)
  150.  *    TEXTUREs, for sharing bitmap information for TEXTURESHADERS
  151.  *    VIEWHINTs, which specifies viewing preferences in FILEs
  152.  */
  153. typedef TQ3SharedObject            TQ3RendererObject;
  154. typedef TQ3SharedObject            TQ3DrawContextObject;
  155. typedef TQ3SharedObject            TQ3SetObject;
  156. typedef TQ3SharedObject            TQ3FileObject;
  157. typedef TQ3SharedObject            TQ3ShapeObject;
  158. typedef TQ3SharedObject            TQ3ShapePartObject;
  159. typedef TQ3SharedObject            TQ3ControllerStateObject;
  160. typedef TQ3SharedObject            TQ3TrackerObject;
  161. typedef TQ3SharedObject            TQ3StringObject;
  162. typedef TQ3SharedObject            TQ3StorageObject;
  163. typedef TQ3SharedObject            TQ3TextureObject;
  164. typedef TQ3SharedObject            TQ3ViewHintsObject;
  165.  
  166.  
  167. /*
  168.  * There is one types of SET:
  169.  *    ATTRIBUTESETs, which contain ATTRIBUTEs which are inherited 
  170.  */
  171. typedef TQ3SetObject                TQ3AttributeSet;
  172.  
  173. /*
  174.  * There are many types of SHAPEs:
  175.  *    LIGHTs, which affect how the RENDERER draws 3-D cues
  176.  *    CAMERAs, which affects the location and orientation of the RENDERER in space
  177.  *    GROUPs, which may contain any number of SHARED OBJECTS
  178.  *    GEOMETRYs, which are representations of three-dimensional data
  179.  *    SHADERs, which affect how colors are drawn on a geometry
  180.  *    STYLEs, which affect how the RENDERER paints to the DRAWCONTEXT
  181.  *    TRANSFORMs, which affect the coordinate system in the VIEW
  182.  *    REFERENCEs, which are references to objects in FILEs
  183.  *  UNKNOWN, which hold unknown objects read from a metafile.
  184.  */
  185. typedef TQ3ShapeObject            TQ3GroupObject;
  186. typedef TQ3ShapeObject            TQ3GeometryObject;
  187. typedef TQ3ShapeObject            TQ3ShaderObject;
  188. typedef TQ3ShapeObject            TQ3StyleObject;
  189. typedef TQ3ShapeObject            TQ3TransformObject;
  190. typedef TQ3ShapeObject            TQ3LightObject;
  191. typedef TQ3ShapeObject            TQ3CameraObject;
  192. typedef TQ3ShapeObject            TQ3UnknownObject;
  193. typedef TQ3ShapeObject            TQ3ReferenceObject;
  194.  
  195. /*
  196.  * For now, there is only one type of SHAPEPARTs:
  197.  *    MESHPARTs, which describe some part of a mesh
  198.  */
  199. typedef TQ3ShapePartObject        TQ3MeshPartObject;
  200.  
  201. /*
  202.  * There are three types of MESHPARTs:
  203.  *    MESHFACEPARTs, which describe a face of a mesh
  204.  *    MESHEDGEPARTs, which describe a edge of a mesh
  205.  *    MESHVERTEXPARTs, which describe a vertex of a mesh
  206.  */
  207. typedef TQ3MeshPartObject        TQ3MeshFacePartObject;
  208. typedef TQ3MeshPartObject        TQ3MeshEdgePartObject;
  209. typedef TQ3MeshPartObject        TQ3MeshVertexPartObject;
  210.  
  211. /*
  212.  * A DISPLAY Group can be drawn to a view
  213.  */
  214. typedef TQ3GroupObject            TQ3DisplayGroupObject;
  215.  
  216. /*
  217.  * There are many types of SHADERs:
  218.  *    SURFACESHADERs, which affect how the surface of a geometry is painted
  219.  *    ILLUMINATIONSHADERs, which affect how lights affect the color of a surface
  220.  */
  221. typedef TQ3ShaderObject            TQ3SurfaceShaderObject;
  222. typedef TQ3ShaderObject            TQ3IlluminationShaderObject;
  223.  
  224. /*
  225.  * A handle to an object in a group
  226.  */
  227. typedef struct TQ3GroupPositionPrivate    *TQ3GroupPosition;
  228.  
  229.  
  230. /******************************************************************************
  231.  **                                                                             **
  232.  **                            Client/Server Things                             **
  233.  **                                                                             **
  234.  *****************************************************************************/
  235.  
  236. typedef void *TQ3ControllerRef;
  237.  
  238.  
  239. /******************************************************************************
  240.  **                                                                             **
  241.  **                            Flags and Switches                                 **
  242.  **                                                                             **
  243.  *****************************************************************************/
  244.  
  245. typedef enum TQ3Boolean {
  246.     kQ3False,
  247.     kQ3True
  248. } TQ3Boolean;
  249.  
  250. typedef enum TQ3Switch {
  251.     kQ3Off,
  252.     kQ3On
  253. } TQ3Switch;
  254.  
  255. typedef enum TQ3Status {
  256.     kQ3Failure,
  257.     kQ3Success
  258. } TQ3Status;
  259.  
  260. typedef enum TQ3Axis {
  261.     kQ3AxisX,
  262.     kQ3AxisY,
  263.     kQ3AxisZ
  264. } TQ3Axis;
  265.  
  266. typedef enum TQ3PixelType {
  267.     kQ3PixelTypeRGB32,
  268.     kQ3PixelTypeRGB24,
  269.     kQ3PixelTypeRGB16,
  270.     kQ3PixelTypeRGB8
  271. } TQ3PixelType;
  272.  
  273. typedef enum TQ3Endian{
  274.     kQ3EndianBig,
  275.     kQ3EndianLittle
  276. } TQ3Endian;
  277.  
  278. typedef enum TQ3EndCapMasks {
  279.     kQ3EndCapNone            = 0,
  280.     kQ3EndCapMaskTop        = 1 << 0,
  281.     kQ3EndCapMaskBottom        = 1 << 1
  282. } TQ3EndCapMasks;
  283.  
  284. typedef unsigned long TQ3EndCap;
  285.  
  286.  
  287. /******************************************************************************
  288.  **                                                                             **
  289.  **                        Point and Vector Definitions                         **
  290.  **                                                                             **
  291.  *****************************************************************************/
  292.  
  293. typedef struct TQ3Vector2D {
  294.     float        x;
  295.     float        y;
  296. } TQ3Vector2D;
  297.  
  298. typedef struct TQ3Vector3D {
  299.     float         x;
  300.     float        y;
  301.     float        z;
  302. } TQ3Vector3D;
  303.  
  304. typedef struct TQ3Point2D {
  305.     float        x;
  306.     float        y;
  307. } TQ3Point2D;
  308.  
  309. typedef struct TQ3Point3D {
  310.     float         x;
  311.     float        y;
  312.     float        z;
  313. } TQ3Point3D;
  314.  
  315. typedef struct TQ3RationalPoint4D {
  316.     float         x;
  317.     float        y;
  318.     float        z;
  319.     float        w;
  320. } TQ3RationalPoint4D;
  321.  
  322. typedef struct TQ3RationalPoint3D {
  323.     float        x;
  324.     float        y;
  325.     float        w;
  326. } TQ3RationalPoint3D;
  327.  
  328.  
  329. /******************************************************************************
  330.  **                                                                             **
  331.  **                                Quaternion                                     **
  332.  **                                                                             **
  333.  *****************************************************************************/
  334.  
  335. typedef struct TQ3Quaternion {
  336.     float        w;
  337.     float        x;
  338.     float        y;
  339.     float        z;
  340. } TQ3Quaternion;
  341.  
  342.  
  343. /******************************************************************************
  344.  **                                                                             **
  345.  **                                Ray Definition                                 **
  346.  **                                                                             **
  347.  *****************************************************************************/
  348.  
  349. typedef struct TQ3Ray3D {
  350.     TQ3Point3D        origin;
  351.     TQ3Vector3D        direction;
  352. } TQ3Ray3D;
  353.  
  354.  
  355. /******************************************************************************
  356.  **                                                                             **
  357.  **                        Parameterization Data Structures                     **
  358.  **                                                                             **
  359.  *****************************************************************************/
  360.  
  361. typedef struct TQ3Param2D {
  362.     float            u;
  363.     float            v;
  364. } TQ3Param2D;
  365.  
  366. typedef struct TQ3Param3D {
  367.     float            u;
  368.     float            v;
  369.     float            w;
  370. } TQ3Param3D;
  371.  
  372. typedef struct TQ3Tangent2D {
  373.     TQ3Vector3D        uTangent;
  374.     TQ3Vector3D        vTangent;
  375. } TQ3Tangent2D;
  376.  
  377. typedef struct TQ3Tangent3D {
  378.     TQ3Vector3D        uTangent;
  379.     TQ3Vector3D        vTangent;
  380.     TQ3Vector3D        wTangent;
  381. } TQ3Tangent3D;
  382.  
  383.  
  384. /******************************************************************************
  385.  **                                                                             **
  386.  **                        Polar and Spherical Coordinates                         **
  387.  **                                                                             **
  388.  *****************************************************************************/
  389.  
  390.  typedef struct TQ3PolarPoint {
  391.      float        r;
  392.      float        theta;
  393.   } TQ3PolarPoint;
  394.  
  395.  typedef struct TQ3SphericalPoint {
  396.      float        rho;
  397.      float        theta;
  398.      float        phi;
  399.  } TQ3SphericalPoint;
  400.  
  401.  
  402. /******************************************************************************
  403.  **                                                                             **
  404.  **                            Color Definition                                 **
  405.  **                                                                             **
  406.  *****************************************************************************/
  407.  
  408. typedef struct TQ3ColorRGB {
  409.     float             r;
  410.     float            g;
  411.     float            b;
  412. } TQ3ColorRGB;
  413.  
  414.  
  415. typedef struct TQ3ColorARGB {
  416.     float             a;
  417.     float             r;
  418.     float            g;
  419.     float            b;
  420. } TQ3ColorARGB;
  421.  
  422.  
  423. /******************************************************************************
  424.  **                                                                             **
  425.  **                                    Vertices                                 **
  426.  **                                                                             **
  427.  *****************************************************************************/
  428.  
  429. typedef struct TQ3Vertex3D {
  430.     TQ3Point3D            point;
  431.     TQ3AttributeSet        attributeSet;
  432. }  TQ3Vertex3D;
  433.  
  434.  
  435. /******************************************************************************
  436.  **                                                                             **
  437.  **                                    Matrices                                 **
  438.  **                                                                             **
  439.  *****************************************************************************/
  440.  
  441. typedef struct TQ3Matrix3x3 {
  442.     float    value[3][3];
  443. } TQ3Matrix3x3;
  444.  
  445. typedef struct TQ3Matrix4x4 {
  446.     float    value[4][4];
  447. } TQ3Matrix4x4;
  448.  
  449.  
  450. /******************************************************************************
  451.  **                                                                             **
  452.  **                                Bitmap/Pixmap                                 **
  453.  **                                                                             **
  454.  *****************************************************************************/
  455.  
  456. typedef struct TQ3Pixmap {
  457.     void                *image;
  458.     unsigned long        width;
  459.     unsigned long        height;
  460.     unsigned long        rowBytes;
  461.     unsigned long        pixelSize;
  462.     TQ3PixelType        pixelType;
  463.     TQ3Endian            bitOrder;
  464.     TQ3Endian            byteOrder;
  465. } TQ3Pixmap;
  466.  
  467. typedef struct TQ3StoragePixmap {
  468.     TQ3StorageObject    image;
  469.     unsigned long        width;
  470.     unsigned long        height;
  471.     unsigned long        rowBytes;
  472.     unsigned long        pixelSize;
  473.     TQ3PixelType        pixelType;
  474.     TQ3Endian            bitOrder;
  475.     TQ3Endian            byteOrder;
  476. } TQ3StoragePixmap;
  477.  
  478. typedef struct TQ3Bitmap {
  479.     unsigned char        *image;
  480.     unsigned long        width;
  481.     unsigned long        height;
  482.     unsigned long        rowBytes;
  483.     TQ3Endian            bitOrder;
  484. } TQ3Bitmap;
  485.  
  486.  
  487. #ifdef __cplusplus
  488. extern "C" {
  489. #endif    /* __cplusplus */
  490.  
  491.  
  492. QD3D_EXPORT TQ3Status Q3Bitmap_Empty(
  493.     TQ3Bitmap            *bitmap);
  494.  
  495. QD3D_EXPORT unsigned long Q3Bitmap_GetImageSize(
  496.     unsigned long        width,
  497.     unsigned long        height);
  498.  
  499.  
  500. #ifdef __cplusplus
  501. }
  502. #endif    /* __cplusplus */
  503.  
  504.  
  505. /******************************************************************************
  506.  **                                                                             **
  507.  **                        Higher dimension quantities                             **
  508.  **                                                                             **
  509.  *****************************************************************************/
  510.  
  511. typedef struct TQ3Area {
  512.     TQ3Point2D             min;
  513.     TQ3Point2D             max;
  514. } TQ3Area;
  515.  
  516. typedef struct TQ3PlaneEquation {
  517.     TQ3Vector3D            normal;
  518.     float                constant;
  519. } TQ3PlaneEquation;
  520.  
  521. typedef struct TQ3BoundingBox {
  522.     TQ3Point3D             min;
  523.     TQ3Point3D             max;
  524.     TQ3Boolean            isEmpty;
  525. } TQ3BoundingBox;
  526.  
  527. typedef struct TQ3BoundingSphere {
  528.     TQ3Point3D            origin;
  529.     float                radius;
  530.     TQ3Boolean            isEmpty;
  531. } TQ3BoundingSphere;
  532.  
  533. /*
  534.  *    The TQ3ComputeBounds flag passed to StartBoundingBox or StartBoundingSphere
  535.  *    calls in the View. It's a hint to the system as to how it should 
  536.  *    compute the bbox of a shape:
  537.  *
  538.  *    kQ3ComputeBoundsExact:    
  539.  *        Vertices of shapes are transformed into world space and
  540.  *        the world space bounding box is computed from them.  Slow!
  541.  *    
  542.  *    kQ3ComputeBoundsApproximate: 
  543.  *        A local space bounding box is computed from a shape's
  544.  *        vertices.  This bbox is then transformed into world space,
  545.  *        and its bounding box is taken as the shape's approximate
  546.  *        bbox.  Fast but the bbox is larger than optimal.
  547.  */
  548.  
  549. typedef enum TQ3ComputeBounds {
  550.     kQ3ComputeBoundsExact,
  551.     kQ3ComputeBoundsApproximate
  552. } TQ3ComputeBounds;
  553.  
  554.  
  555. /******************************************************************************
  556.  **                                                                             **
  557.  **                            Object System Types                                 **
  558.  **                                                                             **
  559.  *****************************************************************************/
  560.  
  561. typedef struct TQ3ObjectClassPrivate        *TQ3ObjectClass;
  562.  
  563. typedef unsigned long                         TQ3MethodType;
  564.  
  565. /*
  566.  * Object methods
  567.  */
  568. #define kQ3MethodTypeObjectUnregister        Q3_METHOD_TYPE('u','n','r','g')
  569.  
  570. /*
  571.  * IO Methods
  572.  */
  573. #define kQ3MethodTypeObjectFileVersion        Q3_METHOD_TYPE('v','e','r','s') /* version */
  574. #define kQ3MethodTypeObjectTraverse            Q3_METHOD_TYPE('t','r','v','s') /* byte count */
  575. #define kQ3MethodTypeObjectWrite            Q3_METHOD_TYPE('w','r','i','t') /* Dump info to file */
  576. #define kQ3MethodTypeObjectReadData            Q3_METHOD_TYPE('r','d','d','t') /* Read info from file into buffer or, attach read data to parent */ 
  577.  
  578. typedef void (*TQ3FunctionPointer)(
  579.     void);
  580.  
  581. typedef TQ3FunctionPointer (*TQ3MetaHandler)(
  582.     TQ3MethodType        methodType);
  583.  
  584. /*
  585.  * MetaHandler:
  586.  *        When you give a metahandler to QuickDraw 3D, it is called multiple times to
  587.  *        build method tables, and then is thrown away. You are guaranteed that
  588.  *        your metahandler will never be called again after a call that was passed
  589.  *        a metahandler returns.
  590.  *
  591.  *        Your metahandler should contain a switch on the methodType passed to it
  592.  *        and should return the corresponding method as an TQ3FunctionPointer.
  593.  *
  594.  *        IMPORTANT: A metaHandler MUST always "return" a value. If you are
  595.  *        passed a methodType that you do not understand, ALWAYS return NULL.
  596.  *
  597.  *        These types here are prototypes of how your functions should look.
  598.  */
  599.  
  600. typedef TQ3Status (*TQ3ObjectUnregisterMethod)(
  601.     TQ3ObjectClass        objectClass);
  602.     
  603. /*
  604.  * See QD3DIO.h for the IO method types: 
  605.  *        ObjectReadData, ObjectTraverse, ObjectWrite
  606.  */
  607.  
  608. /******************************************************************************
  609.  **                                                                             **
  610.  **                            Object System Macros                             **
  611.  **                                                                             **
  612.  *****************************************************************************/
  613.  
  614. #define Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d)         \
  615.             ((const unsigned long)                     \
  616.             ((const unsigned long) (a) << 24) |     \
  617.             ((const unsigned long) (b) << 16) |        \
  618.             ((const unsigned long) (c) << 8)  |     \
  619.             ((const unsigned long) (d)))
  620.  
  621. #define Q3_OBJECT_TYPE(a,b,c,d) \
  622.     ((TQ3ObjectType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  623.     
  624. #define Q3_METHOD_TYPE(a,b,c,d) \
  625.     ((TQ3MethodType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  626.  
  627.  
  628. /******************************************************************************
  629.  **                                                                             **
  630.  **                                Object Types                                 **
  631.  **                                                                             **
  632.  *****************************************************************************/
  633.  
  634. /*
  635.  * Note:    a call to Q3Foo_GetType will return a value kQ3FooTypeBar
  636.  *            e.g. Q3Shared_GetType(object) returns kQ3SharedTypeShape, etc.
  637.  */
  638. #define kQ3ObjectTypeInvalid                            0
  639. #define kQ3ObjectTypeView                                Q3_OBJECT_TYPE('v','i','e','w')
  640. #define kQ3ObjectTypeElement                            Q3_OBJECT_TYPE('e','l','m','n')
  641.     #define kQ3ElementTypeAttribute                        Q3_OBJECT_TYPE('e','a','t','t')
  642. #define kQ3ObjectTypePick                                Q3_OBJECT_TYPE('p','i','c','k')
  643.     #define kQ3PickTypeWindowPoint                        Q3_OBJECT_TYPE('p','k','w','p')
  644.     #define kQ3PickTypeWindowRect                        Q3_OBJECT_TYPE('p','k','w','r')
  645. #define kQ3ObjectTypeShared                                Q3_OBJECT_TYPE('s','h','r','d')
  646.     #define kQ3SharedTypeRenderer                        Q3_OBJECT_TYPE('r','d','d','r')
  647.         #define kQ3RendererTypeWireFrame                Q3_OBJECT_TYPE('w','r','f','r')
  648.         #define kQ3RendererTypeGeneric                    Q3_OBJECT_TYPE('g','n','r','r')
  649.         #define kQ3RendererTypeInteractive                Q3_OBJECT_TYPE('c','t','w','n')
  650.     #define kQ3SharedTypeShape                            Q3_OBJECT_TYPE('s','h','a','p')
  651.         #define kQ3ShapeTypeGeometry                    Q3_OBJECT_TYPE('g','m','t','r')
  652.             #define kQ3GeometryTypeBox                    Q3_OBJECT_TYPE('b','o','x',' ')
  653.             #define kQ3GeometryTypeGeneralPolygon        Q3_OBJECT_TYPE('g','p','g','n')
  654.             #define kQ3GeometryTypeLine                    Q3_OBJECT_TYPE('l','i','n','e')
  655.             #define kQ3GeometryTypeMarker                Q3_OBJECT_TYPE('m','r','k','r')
  656.             #define kQ3GeometryTypeMesh                    Q3_OBJECT_TYPE('m','e','s','h')
  657.             #define kQ3GeometryTypeNURBCurve            Q3_OBJECT_TYPE('n','r','b','c')
  658.             #define kQ3GeometryTypeNURBPatch            Q3_OBJECT_TYPE('n','r','b','p')
  659.             #define kQ3GeometryTypePoint                Q3_OBJECT_TYPE('p','n','t',' ')
  660.             #define kQ3GeometryTypePolygon                Q3_OBJECT_TYPE('p','l','y','g')
  661.             #define kQ3GeometryTypeTriangle                Q3_OBJECT_TYPE('t','r','n','g')
  662.             #define kQ3GeometryTypeTriGrid                Q3_OBJECT_TYPE('t','r','i','g')
  663.         #define kQ3ShapeTypeShader                        Q3_OBJECT_TYPE('s','h','d','r')
  664.             #define kQ3ShaderTypeSurface                Q3_OBJECT_TYPE('s','u','s','h')
  665.                 #define kQ3SurfaceShaderTypeTexture        Q3_OBJECT_TYPE('t','x','s','u')
  666.             #define kQ3ShaderTypeIllumination            Q3_OBJECT_TYPE('i','l','s','h')
  667.                 #define kQ3IlluminationTypePhong        Q3_OBJECT_TYPE('p','h','i','l')
  668.                 #define kQ3IlluminationTypeLambert        Q3_OBJECT_TYPE('l','m','i','l')
  669.                 #define kQ3IlluminationTypeNULL            Q3_OBJECT_TYPE('n','u','i','l')
  670.         #define kQ3ShapeTypeStyle                        Q3_OBJECT_TYPE('s','t','y','l')
  671.             #define kQ3StyleTypeBackfacing                Q3_OBJECT_TYPE('b','c','k','f')
  672.             #define kQ3StyleTypeInterpolation            Q3_OBJECT_TYPE('i','n','t','p')
  673.             #define kQ3StyleTypeFill                    Q3_OBJECT_TYPE('f','i','s','t')
  674.             #define kQ3StyleTypePickID                    Q3_OBJECT_TYPE('p','k','i','d')
  675.             #define kQ3StyleTypeReceiveShadows            Q3_OBJECT_TYPE('r','c','s','h')
  676.             #define kQ3StyleTypeHighlight                Q3_OBJECT_TYPE('h','i','g','h')
  677.             #define kQ3StyleTypeSubdivision                Q3_OBJECT_TYPE('s','b','d','v')
  678.             #define kQ3StyleTypeOrientation                Q3_OBJECT_TYPE('o','f','d','r')
  679.             #define kQ3StyleTypePickParts                Q3_OBJECT_TYPE('p','k','p','t')
  680.         #define kQ3ShapeTypeTransform                    Q3_OBJECT_TYPE('x','f','r','m')
  681.             #define kQ3TransformTypeMatrix                Q3_OBJECT_TYPE('m','t','r','x')
  682.             #define kQ3TransformTypeScale                Q3_OBJECT_TYPE('s','c','a','l')
  683.             #define kQ3TransformTypeTranslate            Q3_OBJECT_TYPE('t','r','n','s')
  684.             #define kQ3TransformTypeRotate                Q3_OBJECT_TYPE('r','o','t','t')
  685.             #define kQ3TransformTypeRotateAboutPoint     Q3_OBJECT_TYPE('r','t','a','p')
  686.             #define kQ3TransformTypeRotateAboutAxis     Q3_OBJECT_TYPE('r','t','a','a')
  687.             #define kQ3TransformTypeQuaternion            Q3_OBJECT_TYPE('q','t','r','n')
  688.         #define kQ3ShapeTypeLight                        Q3_OBJECT_TYPE('l','g','h','t')
  689.             #define kQ3LightTypeAmbient                    Q3_OBJECT_TYPE('a','m','b','n')
  690.             #define kQ3LightTypeDirectional                Q3_OBJECT_TYPE('d','r','c','t')
  691.             #define kQ3LightTypePoint                    Q3_OBJECT_TYPE('p','n','t','l')
  692.             #define kQ3LightTypeSpot                    Q3_OBJECT_TYPE('s','p','o','t')
  693.         #define kQ3ShapeTypeCamera                        Q3_OBJECT_TYPE('c','m','r','a')
  694.             #define kQ3CameraTypeOrthographic            Q3_OBJECT_TYPE('o','r','t','h')
  695.             #define kQ3CameraTypeViewPlane                Q3_OBJECT_TYPE('v','w','p','l')
  696.             #define kQ3CameraTypeViewAngleAspect        Q3_OBJECT_TYPE('v','a','n','a')
  697.         #define kQ3ShapeTypeGroup                        Q3_OBJECT_TYPE('g','r','u','p')
  698.             #define kQ3GroupTypeDisplay                    Q3_OBJECT_TYPE('d','s','p','g')
  699.                 #define kQ3DisplayGroupTypeOrdered        Q3_OBJECT_TYPE('o','r','d','g')
  700.                 #define kQ3DisplayGroupTypeIOProxy        Q3_OBJECT_TYPE('i','o','p','x')
  701.             #define kQ3GroupTypeLight                    Q3_OBJECT_TYPE('l','g','h','g')
  702.             #define kQ3GroupTypeInfo                    Q3_OBJECT_TYPE('i','n','f','o')
  703.         #define kQ3ShapeTypeUnknown                        Q3_OBJECT_TYPE('u','n','k','n')
  704.             #define kQ3UnknownTypeText                    Q3_OBJECT_TYPE('u','k','t','x')
  705.             #define kQ3UnknownTypeBinary                Q3_OBJECT_TYPE('u','k','b','n')
  706.         #define kQ3ShapeTypeReference                    Q3_OBJECT_TYPE('r','f','r','n')
  707.     #define kQ3SharedTypeSet                            Q3_OBJECT_TYPE('s','e','t',' ')
  708.         #define kQ3SetTypeAttribute                        Q3_OBJECT_TYPE('a','t','t','r')
  709.     #define kQ3SharedTypeDrawContext                    Q3_OBJECT_TYPE('d','c','t','x')
  710.         #define kQ3DrawContextTypePixmap                Q3_OBJECT_TYPE('d','p','x','p')
  711.         #define kQ3DrawContextTypeMacintosh                Q3_OBJECT_TYPE('d','m','a','c')
  712.     #define kQ3SharedTypeTexture                        Q3_OBJECT_TYPE('t','x','t','r')
  713.         #define kQ3TextureTypePixmap                    Q3_OBJECT_TYPE('t','x','p','m')
  714.     #define kQ3SharedTypeFile                            Q3_OBJECT_TYPE('f','i','l','e')
  715.     #define kQ3SharedTypeStorage                        Q3_OBJECT_TYPE('s','t','r','g')
  716.         #define kQ3StorageTypeMemory                    Q3_OBJECT_TYPE('m','e','m','s')
  717.             #define kQ3MemoryStorageTypeHandle            Q3_OBJECT_TYPE('h','n','d','l')
  718.         #define kQ3StorageTypeUnix                        Q3_OBJECT_TYPE('u','x','s','t')
  719.             #define kQ3UnixStorageTypePath                Q3_OBJECT_TYPE('u','n','i','x')
  720.         #define kQ3StorageTypeMacintosh                    Q3_OBJECT_TYPE('m','a','c','n')
  721.             #define kQ3MacintoshStorageTypeFSSpec        Q3_OBJECT_TYPE('m','a','c','p')                    
  722.     #define kQ3SharedTypeString                            Q3_OBJECT_TYPE('s','t','r','n')
  723.         #define kQ3StringTypeCString                    Q3_OBJECT_TYPE('s','t','r','c')
  724.     #define kQ3SharedTypeShapePart                        Q3_OBJECT_TYPE('s','p','r','t')
  725.         #define kQ3ShapePartTypeMeshPart                Q3_OBJECT_TYPE('s','p','m','h')
  726.             #define kQ3MeshPartTypeMeshFacePart            Q3_OBJECT_TYPE('m','f','a','c')
  727.             #define kQ3MeshPartTypeMeshEdgePart            Q3_OBJECT_TYPE('m','e','d','g')
  728.             #define kQ3MeshPartTypeMeshVertexPart        Q3_OBJECT_TYPE('m','v','t','x')
  729.     #define kQ3SharedTypeControllerState                Q3_OBJECT_TYPE('c','t','s','t')
  730.     #define kQ3SharedTypeTracker                        Q3_OBJECT_TYPE('t','r','k','r')
  731.     #define kQ3SharedTypeViewHints                        Q3_OBJECT_TYPE('v','w','h','n')
  732. #define kQ3ObjectTypeEndGroup                            Q3_OBJECT_TYPE('e','n','d','g')
  733.  
  734. #ifdef __cplusplus
  735. extern "C" {
  736. #endif    /* __cplusplus */
  737.  
  738. /******************************************************************************
  739.  **                                                                             **
  740.  **                            QuickDraw 3D System Routines                     **
  741.  **                                                                             **
  742.  *****************************************************************************/
  743.  
  744. QD3D_EXPORT TQ3Status Q3Initialize(
  745.     void);
  746.  
  747. QD3D_EXPORT TQ3Status Q3Exit(
  748.     void);
  749.  
  750. QD3D_EXPORT TQ3Boolean Q3IsInitialized(
  751.     void);
  752.  
  753. QD3D_EXPORT TQ3Status Q3GetVersion(
  754.     unsigned long        *majorRevision,
  755.     unsigned long        *minorRevision);
  756.  
  757.  
  758. /******************************************************************************
  759.  **                                                                             **
  760.  **                            ObjectClass Routines                             **
  761.  **                                                                             **
  762.  *****************************************************************************/
  763.  
  764. QD3D_EXPORT TQ3Status Q3ObjectClass_Unregister(
  765.     TQ3ObjectClass        objectClass);
  766.  
  767.  
  768. /******************************************************************************
  769.  **                                                                             **
  770.  **                                Object Routines                                 **
  771.  **                                                                             **
  772.  *****************************************************************************/
  773.  
  774. QD3D_EXPORT TQ3Status Q3Object_Dispose(
  775.     TQ3Object             object);
  776.     
  777. QD3D_EXPORT TQ3Object Q3Object_Duplicate(
  778.     TQ3Object            object);
  779.     
  780. QD3D_EXPORT TQ3Status Q3Object_Submit(
  781.     TQ3Object            object,
  782.     TQ3ViewObject        view);
  783.     
  784. QD3D_EXPORT TQ3Boolean Q3Object_IsDrawable(
  785.     TQ3Object            object);
  786.  
  787. QD3D_EXPORT TQ3Boolean Q3Object_IsWritable(
  788.     TQ3Object            object,
  789.     TQ3FileObject        file);
  790.  
  791.  
  792. /******************************************************************************
  793.  **                                                                             **
  794.  **                            Object Type Routines                             **
  795.  **                                                                             **
  796.  *****************************************************************************/
  797.  
  798. QD3D_EXPORT TQ3ObjectType Q3Object_GetType(
  799.     TQ3Object            object);
  800.  
  801. QD3D_EXPORT TQ3ObjectType Q3Object_GetLeafType(
  802.     TQ3Object            object);
  803.  
  804. QD3D_EXPORT TQ3Boolean Q3Object_IsType(
  805.     TQ3Object            object,
  806.     TQ3ObjectType        type);
  807.  
  808.  
  809. /******************************************************************************
  810.  **                                                                             **
  811.  **                            Shared Object Routines                             **
  812.  **                                                                             **
  813.  *****************************************************************************/
  814.  
  815. QD3D_EXPORT TQ3ObjectType Q3Shared_GetType(
  816.     TQ3SharedObject     sharedObject);
  817.  
  818. QD3D_EXPORT TQ3SharedObject Q3Shared_GetReference(
  819.     TQ3SharedObject     sharedObject);
  820.  
  821.  
  822. /******************************************************************************
  823.  **                                                                             **
  824.  **                                Shape Routines                                 **
  825.  **                                                                             **
  826.  *****************************************************************************/
  827.  
  828. QD3D_EXPORT TQ3ObjectType Q3Shape_GetType(
  829.     TQ3ShapeObject    shape);
  830.  
  831. QD3D_EXPORT TQ3Status Q3Shape_GetSet(
  832.     TQ3ShapeObject    shape,
  833.     TQ3SetObject    *set);
  834.  
  835. QD3D_EXPORT TQ3Status Q3Shape_SetSet(
  836.     TQ3ShapeObject    shape,
  837.     TQ3SetObject     set);
  838.  
  839.  
  840. #ifdef __cplusplus
  841. }
  842. #endif  /*  __cplusplus  */
  843.  
  844. #endif /*  QD3D_h  */
  845.